-
-
Notifications
You must be signed in to change notification settings - Fork 28.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Vorwerk integration #45749
Add Vorwerk integration #45749
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good start 😃 - just handful of lint errors and a few additional comments.
Tests will be needed for the config flow as well |
Where can I found a tutorial or the documentation ? |
Check the |
Hope, I will find the time this week. :) |
@cgarwood can you tell me whats the correct way to fix the hassfest and Check all requirements failures? |
26cbacb
to
8773d1d
Compare
a5fceaa
to
1dd8205
Compare
Checks passed :) |
@cgarwood @eavanvalkenburg Anything new? Could you merge my Pull Request? Is anything missing? |
Good from my standpoint, but probably good for one of the more experienced reviewers to give it a look over. |
@cgarwood I integrated all requested changes. But the PR is still in "Awaiting requested changes" on the https://github.com/home-assistant/core/projects/5#card-55498357 board. What is missing? How is the future process to integrate this PR? |
homeassistant/components/vorwerk/__init__.py | ||
homeassistant/components/vorwerk/vacuum.py |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not compulsory, but since new integrations can take a while to get merged, I suggest that you take the opportunity to move to 100% coverage whilst the reviews are in progress.
homeassistant/components/vorwerk/__init__.py | |
homeassistant/components/vorwerk/vacuum.py |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will improve that over Christmas.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is there to do? Just removing these lines? I want to help.
96b699d
to
873c410
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments
async def async_setup(hass: HomeAssistantType, config: ConfigType) -> bool: | ||
"""Set up the Vorwerk component.""" | ||
hass.data[VORWERK_DOMAIN] = {} | ||
|
||
if VORWERK_DOMAIN in config: | ||
hass.async_create_task( | ||
hass.config_entries.flow.async_init( | ||
VORWERK_DOMAIN, | ||
context={"source": SOURCE_IMPORT}, | ||
data=config[VORWERK_DOMAIN], | ||
) | ||
) | ||
|
||
return True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove as not needed for new integrations
), | ||
) | ||
|
||
async def async_step_code(self, user_input: dict[str, Any] = None) -> FlowResult: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
async def async_step_code(self, user_input: dict[str, Any] = None) -> FlowResult: | |
async def async_step_code(self, user_input: dict[str, Any] | None = None) -> FlowResult: |
return self.async_create_entry( | ||
title=self._email, | ||
data={ | ||
CONF_EMAIL: self._email, | ||
CONF_TOKEN: self._session.token, | ||
VORWERK_ROBOTS: robots, | ||
}, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move outside of try
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then an extra if
is needed. I don't think that makes the code more readable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is compulsory to move it out of the try block, but you can use try...except...else
form
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@epenet I will try that.
async def async_step_import(self, user_input: dict[str, Any]) -> FlowResult: | ||
"""Import a config flow from configuration.""" | ||
unique_id = "from configuration" | ||
data = {VORWERK_ROBOTS: user_input} | ||
|
||
await self.async_set_unique_id(unique_id) | ||
self._abort_if_unique_id_configured(data) | ||
|
||
_LOGGER.info("Creating new Vorwerk robot config entry") | ||
return self.async_create_entry( | ||
title="from configuration", | ||
data=data, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New integration needs no import
VORWERK_ROBOT_TRAITS = "traits" | ||
VORWERK_ROBOT_ENDPOINT = "endpoint" | ||
|
||
VORWERK_PLATFORMS = ["vacuum"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please resolve conflicts. Thanks 👍
Is any progress planned? I really would like to integrate the VR300 into my smart home, so I really appreciate your idea and work to integrate it. |
Yes, but my PR is now over one year old and the feed back loop from HA is quite slow. |
@trunneml Friendly notification/ping, the review comments from @gjohansson-ST haven't been touched/implemented/processed yet and there is a merge conflict. Would you have time to pick this PR up again? ../Frenck |
@frenck HI thanks for the reminder. I'm quite busy currently, but I will try to fix this. But after over one year to get this integration into Home-Assistant I'm questioning if this PR is the correct way. Neato and Vorwerk Vacuum cleaners are both based on Please don't get me wrong all review findings were correct and the code is better now. But now it is no longer a fork of the neato integration. It is more a recode of it and that was not my intention when I started this PR. Maybe it is a better idea to add the Vorwerk-Auth0 authentication to the neato integration. @dshokouhi and @Santober what do you think about this idea? Could you help me? The ConfigFlow in this PR works for over one year now and I also have a working What I'm not familiar with is the Home Assistant oauth2 token handling. Who could help me with that part? |
Alright, considering the above response I think we can conclude this PR by itself will not be moving forwards. Therefore, I'll go ahead and close it. ../Frenck |
@frenck: as I didn't get feedback from @dshokouhi and completly forking from neato doesn't makes sense to me, you can close this PR. |
Proposed change
New Integration to bring back Vorwerk Kobold vacum cleaner support.
Before #44031 it was possible to use the neato integration.
It's possible to configure the integration by the User Config Flow in the UI with E-Mail and Code like the Vorwerk IOS app or by adding the SERIAL+SECRET_KEY of the robot in your configuration.yml. (Serial and secret can be fetched with pybotvac for example.)
VR200 is working. VR300 should work too, but without the map functionality as this needs OAuth and the current Vorwerk + Auth0 setup is somehow strange. It uses the id_token in a Auth0Bearer Authorization Header. And when calling a token refresh Python complains about the scope of the new token.
The custom_clean service supports zone cleaning. This should work with a VR300, but I can't test it as I only have the VR200.
I'm a developer, but new in writing home assistant integrations. Let me know if I should change or add something.
Type of change
Example entry for
configuration.yaml
:Additional information
https://community.home-assistant.io/t/creation-of-vorwerk-kobold-component/253166/12
Checklist
black --fast homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.The integration reached or maintains the following Integration Quality Scale:
To help with the load of incoming pull requests: